<template>
	<view class="container">
		<view class="keshi-l">
			<view @click="changekeshi(item.id)" v-for="(item,index) in keshiList" :key="index" class="keshi-l-item">
				{{item.name}}
			</view>
		</view>
		<Patient-footer-bar :selected="1" ></Patient-footer-bar>
	</view>
</template>

<script>
	import app from '../../App.vue';
	export default{
		data(){
			return{
				part:0,
				keshiList:[]
			}
		},
		onLoad() {
		
		},
		onShow() {
			this.getkeshiList()
		},
		methods: {
			changekeshi(id){
				uni.showLoading({
					title:'加载中',
					success() {
						setTimeout(function(){
							uni.hideLoading({
								success:res=>{
									uni.navigateTo({
										url:'/pages/keshi/detail?id='+id
									})
								}
							})
						},1300)
					}
				})
			},
			
			getkeshiList(){     //科室列表
				let that = this
				app.post('api/department/lis',{},'POST').then(res=>{
					if(res.code == 1 && res.data != ''){
						that.keshiList = res.data
					}
				}).catch(err=>{
					uni.showToast({
						title:err.msg,
						icon:'none',
						mark:true
					})
				})
			}
		}
	}
</script>

<style>
	@import url("../../common/keshi.css");
</style>
